<?php
require_once('My_Validator_Email.php');
require_once('library/Zend/Form.php');
require_once('library/Zend/Form/Element/MultiCheckbox.php');

#@todo dodanie walidatora na adrs

/**
 * Foirmularz z adresem cos ala chw
 * ma to byc gotowy komponent ktory ma pobierac adres obiektu w populate
 * @author damian 27-09-2012
 *
 */
class Form_Adres extends Zend_Form
{

	public $url='';
	
	public function __construct($url='')
	{
		parent::__construct(); 
		$this->url=$url;
	}
	
    public function init()
    {
        $this->setMethod('post');
        $this->setAction($this->url);                                   
        $this->addElement('text', 'miasto', array('label' => 'miasto: '));
		$this->addElement('text', 'numer', array('label' => 'numer: '));
        // inna metoda dodawania nowego elementu formularza
        $ulica= new Zend_Form_Element_Text('ulica',array('label'=>'ulica: '));
        $this->addElement('text', 'kod', array('label' => 'kod pocztowy: '));
        
        $this->addElement($ulica);
        
        $this->addElement('submit', 'submit', array('label' => 'Zapisz'));
        
        # kod poczadzacy z ZemdCastu
        /*
        $this->setDecorators(
        						array('FormElements',
        											array('HtmlTag', 
        															array('tag'=>'dl')
        											),
        											'Form'
        								)
        						);*/
    }
}